• viewcustomersellvehicle.php
  • project /
1 <?php
2 include(
"header.php");
3 include(
"sidebar.php");
4
5 include(
"dbconnection.php");
6 //
if(isset($_GET['sellno']))
7 //{
8 //$result = mysql_query(
"select status from vehicle where sellno='$_GET[sellno]'");
9 //$res = mysql_fetch_array($result);
10 //
if($res['status'] == 'Pending')
11 //{
12 //$res = mysql_query(
"update vehicle set status='Accepted' where sellno='$_GET[sellno]'");
13 //$res = mysql_query(
"insert into vehiclestore(empid,vehname,model,brand,images,estprice,description,status) values('$_SESSION[employeeid]','$_GET[vehiclename]','$_GET[model]','$_GET[brand]','$_GET[image]','$_GET[estprice]','$_GET[otherinfo]','Accepted')");
14 //}
15 //
else
16 //{
17 //$res = mysql_query(
"update vehicle set status='Pending' where sellno='$_GET[sellno]'");
18 //}
19 //}

20 if
(isset($_GET["st"]))
21 {
22 $res = mysql_query(
"update vehicle set status='Rejected' where sellno='$_GET[sellno]'");
23 }
24
25 $result= mysql_query(
"select * from vehicle");
26 ?>
27         
28                             
29         <div id=
"main">
30             
31             <a name=
"TemplateInfo"></a>
32             <h1>Sell Vehicle</h1>
33             <?php

34 if
($ctins == 1)
35 {
36     echo
"<center><b>Employees account created successfully...</b></center><br>";
37     echo
"<center><b><a href='emplogin.php'>Click here to Login.</a></b></center>";
38 }

39 else

40 {
41     ?>
42     
43     
44         <form id=
"form1" name="form1" method="post" action="">
45           <table width=
"778" border="1">
46             <tr>
47               <th width=
"62" scope="col">Sell No</th>
48               <th width=
"152" scope="col">Customer Name</th>
49               <th width=
"273" scope="col">Vehicle info</th>
50               <th width=
"161" scope="col">Estimated price</th>
51               <th width=
"185" scope="col">Vehicle status</th>
52             </tr>
53             <?php
54           
while($arrrec= mysql_fetch_array($result))
55           {
56           ?>
57           <tr>
58               <td>&nbsp;<?php echo $arrrec[sellno]; ?></td>
59               <td>&nbsp;<?php
60               
61 $result1= mysql_query(
"select * from customer where custid='$arrrec[custid]'");
62     $arrrec1= mysql_fetch_array($result1);
63           echo $arrrec1[fname].
" ".$arrrec1[lname];
64               ?></td>
65               <td>
66               <img src=
'upload/<?php echo $arrrec[images]; ?>' width='75' height='75' align='left'>&nbsp;<font color="green"><b><?php echo $arrrec[vehname]; ?></b></font><br>
67                       <b> Model : </b><?php echo $arrrec[model]; ?><br>
68                       <b>Brand : </b><?php echo $arrrec[brand]; ?></td>
69               <td>&nbsp;&nbsp;Dhs.&nbsp;<?php echo $arrrec[estmdprice]; ?></td>
70               <td>&nbsp;<?php
71                
if($arrrec[status] == 'Accepted' || $arrrec[status] == 'Rejected')
72                {
73                echo $arrrec[status];
74                }
75                
else
76                {
77 echo
"<a href='acceptvehicle.php?sellno=$arrrec[sellno]&vehiclename=$arrrec[vehname]&model=$arrrec[model]&brand=$arrrec[brand]&image=$arrrec[images]&estprice=$arrrec[estmdprice]&otherinfo=$arrrec[otherinfo]'>Accept</a> | ";
78 echo
"<a href='viewcustomersellvehicle.php?sellno=$arrrec[sellno]&st=reject'>Reject</a>";
79                }
80                ?>
81             </td>
82             </tr>
83             <?php
84           }
85           ?>
86           </table>
87         </form>
88     <?php
89     }
90     ?>
91             <p>&nbsp;</p>
92 <br />
93                                             
94         </div>
95         
96 <!-- wrap ends here -->
97 </div>
98 <?php
99 include(
"footer.php");
100 ?>


Gõ tìm kiếm nhanh...